// 获取我的课程
import request from '@/utils/request';
function getMyLesson(params) {
  return request({
    url: '/prepareLesson/list',
    method: 'get',
    params
  });
};
// 获取班级
function getClass(params) {
  return request({
    url: '/prepareLesson/class',
    method: 'get',
    params: {id: params}
  });
};
// 获取分组
function getGroup(params) {
  return request({
    url: '/prepareLesson/group',
    method: 'get',
    params
  });
};
// 启动课程
function startLesson(data) {
  return request({
    url: '/prepareLesson/status',
    method: 'post',
    data
  });
};
// 获取教学资料
function getMaterial(params) {
  return request({
    url: '/project/material',
    method: 'GET',
    params
  });
};
// 下载教学资料
function uploadMaterial(params) {
  return request({
    url: '/file/byUrl',
    method: 'GET',
    params
  });
};
// 增加分组
function addGroup(params) {
  return request({
    url: '/project/copy',
    method: 'post',
    params
  });
};
// 删除分组
function deleteGroup(params) {
  return request({
    url: '/project',
    method: 'delete',
    params
  });
};
// 修改分组
function updateGroup(data) {
  return request({
    url: '/project/update',
    method: 'post',
    data
  });
};
// 获取机构人员名单
function getRoles(params) {
  return request({
    url: '/project/user',
    method: 'get',
    params
  });
};
// 更改分组名称、项目名称、到期时间等
function updateGroups(data) {
  return request({
    url: '/prepareLesson/update/project',
    method: 'post',
    data
  });
};
// 更改项目经理、组员等
function updateRoles(id, type, data) {
  console.log(id, type, data);
  return request({
    url: `/prepareLesson/update/projectuser/${id}/${type}`,
    method: 'post',
    data
  });
};
export { getMyLesson, getClass, getGroup, startLesson, getMaterial, addGroup, deleteGroup, updateGroup, getRoles, uploadMaterial, updateGroups, updateRoles };
